<?php
echo '['.$html->link(__('Edit message/Schedule invitation',true),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'meetings','action'=>'editemails','id'=>$meeting['Meeting']['id'])).']';
?>
<br/><br/>
<h1>Editing Templates</h1>
<br><br>

<h2><?php __('Inviation Email Preview') ?></h2>
<div id="message_preview">
    <?php echo $invite['Template']['template'];?>
</div>
<?php if(count($to_invite)){?>
    <li><span class="viewtitle"><?php __('Recipients');?>: </span>
        <?php 
            echo "<ul>"; 
            foreach ($to_invite as $user) echo "<li>".$user."</li>";
            echo "</ul>"; 
        ?> 
    </li>
<?php } ?>
<br><br>

<h2><?php __('Change Email Preview') ?></h2>
<div id="message_preview">
    <?php echo $change['Template']['template'];?>
</div>
<?php if(count($to_notify_changes)){?>
    <li><span class="viewtitle"><?php __('Recipients');?>: </span>
        <?php 
            echo "<ul>"; 
            foreach ($to_notify_changes as $user) echo "<li>".$user."</li>";
            echo "</ul>"; 
        ?> 
    </li>
<?php } ?>    
<br><br>

<h2><?php __('Uninvite Email Preview') ?></h2>
<div id="message_preview">
    <?php echo $uninvite['Template']['template'];?>
</div>
<?php if(count($to_uninvite)){?>
     <li><span class="viewtitle"><?php __('Recipients');?>: </span>
        <?php 
            echo "<ul>"; 
            foreach ($to_uninvite as $user) echo "<li>".$user."</li>";
            echo "</ul>"; 
        ?> 
    </li>
<?php } ?>  
<br/>

<?php
    if($meeting['Meeting']['invite_date']){
        $dtext=sprintf(__('Send emails on %s',true),date(Configure::read('date_format'),strtotime($meeting['Meeting']['invite_date'])));
    }else{
        $dtext=__('Send emails now',true);
    }
    echo $html->link($dtext,array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'meetings','action'=>'send_emails','id'=>$meeting['Meeting']['id']),array('class'=>'button'))." ";
    echo $html->link(__('Do not send emails',true),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'meetings','action'=>'index'),array('class'=>'button'));
?>
